/*
 * Copyright (c) 2011. c.mueller
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * The Software shall be used for Good, not Evil.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */

package de.altitude.cimuelle.player;

import java.io.Serializable;

/**
 * User: cybernaut
 * Date: 28.08.11
 * Time: 00:05
 */
public class playerSessionStats implements Serializable {
    private static final long serialVersionUID = 1000020001L;

    private int destroyedTurretsByMap = 0;
    private int destroyedTurrets = 0;
    private int destroyedBasesByMap = 0;
    private int destroyedBases = 0;
    private int killedPlanesByMap = 0;
    private int killedPlanes = 0;
    private int damageDamageDealtToTurrets = 0;

    public playerSessionStats() {
    }

    public int getDestroyedTurrets() {
        return destroyedTurrets;
    }

    public int getDestroyedBases() {
        return destroyedBases;
    }

    public int getKilledPlanes() {
        return killedPlanes;
    }

    public int getDestroyedTurretsByMap() {
        return destroyedTurretsByMap;
    }

    public int getDestroyedBasesByMap() {
        return destroyedBasesByMap;
    }

    public int getKilledPlanesByMap() {
        return killedPlanesByMap;
    }

    public synchronized void resetMapStats() {
        this.destroyedBasesByMap = 0;
        this.destroyedTurretsByMap = 0;
        this.killedPlanesByMap = 0;
    }

    public synchronized void increaseDestroyedBases() {
        ++this.destroyedBases;
        ++this.destroyedBasesByMap;
    }

    public synchronized void increaseDestroyedTurret() {
        ++this.destroyedTurrets;
        ++this.destroyedTurretsByMap;
    }

    public synchronized void increaseKilledPlanes() {
        ++this.killedPlanes;
        ++this.killedPlanesByMap;
    }

    public synchronized void increaseDamageDealtToTurrets(int damage) {
        this.damageDamageDealtToTurrets += damage;
    }

    @Override
    public String toString() {
        return "playerSessionStats{" +
                "destroyedTurretsByMap=" + destroyedTurretsByMap +
                ", destroyedTurrets=" + destroyedTurrets +
                ", destroyedBasesByMap=" + destroyedBasesByMap +
                ", destroyedBases=" + destroyedBases +
                ", killedPlanesByMap=" + killedPlanesByMap +
                ", killedPlanes=" + killedPlanes +
                ", damageDamageDealtToTurrets=" + damageDamageDealtToTurrets +
                '}';
    }
}
